import { cloudService } from './index'
import type { ISession } from '@/types/auth'

export const loginApi = (username: string, password: string): Promise<ISession> =>
  cloudService({
    url: '/food-api/session',
    method: 'post',
    params: { username, password }
  })

export const logoutApi = (username: string): Promise<ISession> =>
  cloudService({
    url: '/food-api/session',
    method: 'delete',
    params: { username }
  })
